package com.hmall.search;

import com.hmall.client.AddressClient;
import com.hmall.client.MyFeignClient;
import org.apache.http.HttpHost;
import org.elasticsearch.client.RestClient;
import org.elasticsearch.client.RestHighLevelClient;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;

@EnableFeignClients(clients = {MyFeignClient.class,AddressClient.class})
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class})
public class SearchApplication {
    public static void main(String[] args) {
        SpringApplication.run(SearchApplication.class, args);
    }

    @Bean
    public RestHighLevelClient init() {
        return new RestHighLevelClient(RestClient.builder(
                new HttpHost("192.168.200.130", 9200, "http")
        ));
    }

}
